<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">修改设备档案</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body am-fr">
                    <form class="am-form tpl-form-line-form" id="machineryInfoForm" method="post" >
                        <input type="hidden" id="id"  name="id" th:value="${record.id}"/>
                        <!--ownerName(机主名称)-->
                        <div class="am-form-group">
                            <label for="ownerName" class="am-u-sm-2 am-form-label">机主名称
                                <span class="tpl-form-line-small-title">ownerName</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="ownerName" class="tpl-form-input" placeholder="请输入" name="ownerName" th:value="${record.ownerName !=null} ? ${record.ownerName} : ''"/>
                            </div>
                        </div>
                        <!--identityNum(机主身份证号)-->
                        <div class="am-form-group">
                            <label for="identityNum" class="am-u-sm-2 am-form-label">机主身份证号
                                <span class="tpl-form-line-small-title">identityNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="identityNum" class="tpl-form-input" placeholder="请输入" name="identityNum" th:value="${record.identityNum !=null} ? ${record.identityNum} : ''"/>
                            </div>
                        </div>
                        <!--buyDate(购置时间)-->
                        <div class="am-form-group">
                            <label for="buyDate" class="am-u-sm-2 am-form-label">购置时间
                                <span class="tpl-form-line-small-title">BuyDate</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="buyDate" class="form-control validate[required]" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="buyDate" placeholder="请选择日期" th:value="${#dates.format(record.buyDate, 'yyyy-MM-dd')}"/>
                                <div class="input-group-btn">
                                </div>
                            </div>
                        </div>
                        <!--plateNum(铭牌号)-->
                        <div class="am-form-group">
                            <label for="plateNum" class="am-u-sm-2 am-form-label">铭牌号
                                <span class="tpl-form-line-small-title">PlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="plateNum" class="tpl-form-input" placeholder="请输入" name="plateNum" th:value="${record.plateNum !=null} ? ${record.plateNum} : ''"/>
                            </div>
                        </div>
                        <!--bigShelfNum(大架子号)-->
                        <div class="am-form-group">
                            <label for="bigShelfNum" class="am-u-sm-2 am-form-label">大架子号
                                <span class="tpl-form-line-small-title">PlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="bigShelfNum" class="tpl-form-input" placeholder="请输入" name="bigShelfNum" th:value="${record.bigShelfNum !=null} ? ${record.bigShelfNum} : ''"/>
                            </div>
                        </div>
                        <!--enginePlateNum(发动机铭牌号)-->
                        <div class="am-form-group">
                            <label for="bigShelfNum" class="am-u-sm-2 am-form-label">发动机铭牌号
                                <span class="tpl-form-line-small-title">EnginePlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="enginePlateNum" class="tpl-form-input" placeholder="请输入" name="enginePlateNum" th:value="${record.enginePlateNum !=null} ? ${record.enginePlateNum} : ''"/>
                            </div>
                        </div>
                        <!--hydraulicPlateNum(液压泵铭牌号)-->
                        <div class="am-form-group">
                            <label for="hydraulicPlateNum" class="am-u-sm-2 am-form-label">液压泵铭牌号
                                <span class="tpl-form-line-small-title">HydraulicPlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="hydraulicPlateNum" class="tpl-form-input" placeholder="请输入" name="hydraulicPlateNum" th:value="${record.hydraulicPlateNum !=null} ? ${record.hydraulicPlateNum} : ''"/>
                            </div>
                        </div>
                        <!--remark(备注信息)-->
                        <div class="am-form-group">
                            <label for="remark" class="am-u-sm-2 am-form-label">备注信息
                                <span class="tpl-form-line-small-title">HydraulicPlateNum</span>
                            </label>
                            <div class="am-u-sm-10">
                                <input type="text" id="remark" class="tpl-form-input" placeholder="请输入" name="remark" th:value="${record.remark !=null} ? ${record.remark} : ''"/>
                            </div>
                        </div>
                        <div class="am-form-group">
                            <div class="am-u-sm-10 am-u-sm-push-2">

                                <button type="button" onclick="return doSubmit();"
                                        class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                <button type="button" onclick="loadPage('machineryInfo/listUI')"
                                        class="am-btn am-btn-success tpl-btn-bg-color-success ">返回</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<script th:inline="javascript">
    <![CDATA[
    //$('select').selected();
    validateUserForm();
    function validateUserForm(){
        valdater=$('#machineryInfoForm').validate({
            errorElement : 'span',
            errorClass : 'am-icon-times',
            focusInvalid : true,
            onkeyup:false,
            ignore : "",
            rules : {
                title : {
                    required : true
                }
            },
            messages : {
                name : {
                    required : "请填写标题"
                }
            }
        });
    }

    function doSubmit(){
        if(valdater.form()){
            commit('machineryInfoForm', 'machineryInfo/save', 'machineryInfo/listUI');
            return true;
        }
        return false;
    }

    ]]>
</script>
<script type="text/javascript" th:src="@{/My97DatePicker/WdatePicker.js}"/>